package com.collect.tanzania.zhiAdater.zhiRecall;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.collect.tanzania.R;
import com.collect.tanzania.zhiBean.zhiReceive.ZHIRWaitCustomerFollowUserListEntity;

public class ZHIRecallAdjuster extends BaseQuickAdapter<ZHIRWaitCustomerFollowUserListEntity, BaseViewHolder> {

    public ZHIRecallAdjuster() {
        super(R.layout.item_recall_list, null);
    }

    private OnZHIRecallAdjusterItemClickListener mOnZHIRecallAdjusterItemClickListener;

    @Override
    protected void convert(BaseViewHolder helper, ZHIRWaitCustomerFollowUserListEntity item) {
        helper.setText(R.id.tv_platform, item.getProduct());
        helper.setText(R.id.tv_mobile, item.getMobileEncryptFormatter());

        if (mOnZHIRecallAdjusterItemClickListener != null) {
            helper.getView(R.id.tv_follow).setOnClickListener(view -> mOnZHIRecallAdjusterItemClickListener.OnItemClick(item));
            helper.getView(R.id.tv_call).setOnClickListener(view -> mOnZHIRecallAdjusterItemClickListener.OnItemMobileClick(item));
            helper.getView(R.id.tv_whatsapp).setOnClickListener(view -> mOnZHIRecallAdjusterItemClickListener.OnItemWhatsAppClick(item));
            helper.getView(R.id.tv_copy_link).setOnClickListener(view -> mOnZHIRecallAdjusterItemClickListener.OnItemCopyAppLinkClick(item));
        }
    }

    public void setOnZHIRecallAdjusterItemClickListener(OnZHIRecallAdjusterItemClickListener listener) {
        this.mOnZHIRecallAdjusterItemClickListener = listener;
    }

    public interface OnZHIRecallAdjusterItemClickListener {
        void OnItemClick(ZHIRWaitCustomerFollowUserListEntity zhirWaitCustomerFollowUserListEntity);
        void OnItemMobileClick(ZHIRWaitCustomerFollowUserListEntity zhirWaitCustomerFollowUserListEntity);
        void OnItemWhatsAppClick(ZHIRWaitCustomerFollowUserListEntity zhirWaitCustomerFollowUserListEntity);
        void OnItemCopyAppLinkClick(ZHIRWaitCustomerFollowUserListEntity zhirWaitCustomerFollowUserListEntity);
    }
}
